﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>pie组件</title>
      <script language="JavaScript" src="/WF/Comm/JScript.js" type="text/javascript" ></script>
    <script type="text/javascript" src="/WF/Scripts/bootstrap/js/jquery.min.js"></script>
    <script type="text/javascript" src="/WF/Scripts/bootstrap/js/bootstrap.min.js"></script>
    <script src="/WF/Scripts/QueryString.js" type="text/javascript"></script>

    <script src="/WF/Comm/JS/echarts.js" type="text/javascript"></script>

    <link href="/DataUser/Style/ccbpm.css" rel="stylesheet"  type="text/css" />
    <link href="/DataUser/Style/table0.css" rel="stylesheet"  type="text/css" />

    <!-- 引用通用的js文件. -->
    <script type="text/javascript" src="/WF/Comm/Gener.js"></script>
    <script type="text/javascript" language="javascript" >
        //页面启动函数.
        $(function () {

            $("#Msg").html("正在加载,请稍后......");

            //获得传递来的报表名称.
            var rptName = GetQueryString("RptName");

            $.ajax({
                type: 'post',
                async: true,
                url: "Handler.ashx?DoType=InitPie&RptName=" + rptName + "&m=" + Math.random(),
                dataType: 'html',
                success: function (data) {

                    data = "{}";
                    alert(data);

                    var dataObj = null;

                    //                    try{

                    dataObj = eval("(" + data + ")");

                    //                    }catch {
                    //                      alert('errr');
                    //                    }

                    alert(dataObj);


                    //  data =
                    //data = JSON.parse(data);
                    // alert(data);

                    var myChart = echarts.init(document.getElementById('main'));
                    alert(myChart);

                    myChart.setOption(dataObj);
                    return;
                }
            });

            $("#Msg").html("");
        });
    </script>
</head>
<body>

<div id="main"> </div>




</body>
</html>
